//
//  KFDMarketTradingStrategyTableViewCell.m
//  
//
//  Created by JIRENTIANXIANG on 6/13/15.
//
//

#import "KFDMarketTradingStrategyTableViewCell.h"
#import "NSDate+format.h"
#import "KFDAccountManager.h"

@interface KFDMarketTradingStrategyTableViewCell ()

@property (strong,nonatomic) KFDTradingStrategy* tradingStrategy;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

@end

@implementation KFDMarketTradingStrategyTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setTradingStrategy:(KFDTradingStrategy *)tradingStrategy detailed:(BOOL)detailed
{
    _tradingStrategy=tradingStrategy;
    self.titleLabel.text=tradingStrategy.title;
    self.contentLabel.text=detailed?tradingStrategy.fullContent:tradingStrategy.stdesc;
    self.timeLabel.text=[NSString stringWithFormat:@"%@ %@",tradingStrategy.date.year_month_day,tradingStrategy.date.hour_minute];
}

- (IBAction)detailsButtonPressed:(id)sender {
    if (self.showDetailsAction) {
        self.showDetailsAction();
    }
}

@end
